/*
 * @Author: sunkai@xinxinapp.cn
 * @Date: 2020-12-28 16:11:42
 * @LastEditTime: 2020-12-28 16:57:21
 * @LastEditors: sunkai@xinxinapp.cn
 * @Description: 
 * @FilePath: /vue-cli-demo/js/dep.js
 */
class Dep {
  constructor () {
    this.subs = []
  }

  addSub (sub) {
    if (sub && sub.update) {
      this.subs.push(sub)
    }
  }
  
  notify () {
    this.subs.forEach(sub => sub.update())
  }
}